import com.java.model.ArticleInfo;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");

        //默认方式
//        ArticleInfo articleInfo=context.getBean("articleInfo",ArticleInfo.class);
        //直接设置
//        ArticleInfo articleInfo=context.getBean("bean1",ArticleInfo.class);
        //设置name
//        ArticleInfo articleInfo=context.getBean("bean2",ArticleInfo.class);
        //设置value
//        ArticleInfo articleInfo=context.getBean("bean3",ArticleInfo.class);
        //重命名扩展，指定多个名字
        ArticleInfo articleInfo=context.getBean("bean5",ArticleInfo.class);
        //注：当使用设置之后默认方法就无法获取

//        Articles articles=context.getBean("articles",Articles.class);

        System.out.println(articleInfo.toString());
//        articles.sayHi();
    }
}
